package com.uphone.magicleafteacher.pro.adapter;

import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.uphone.magicleafteacher.R;
import com.uphone.magicleafteacher.util.CommonUtil;
import com.uphone.magicleafteacher.view.MyBaseViewHolder;
import com.uphone.magicleafteacher.vo.StudentRankBean;

public class StudentRankAdapter extends BaseQuickAdapter<StudentRankBean.GradesBean, MyBaseViewHolder> {
    private final int selectId;

    public StudentRankAdapter(int selectId) {
        super(R.layout.layout_item_rank);
        this.selectId = selectId;
    }

    @Override
    protected void convert(MyBaseViewHolder helper, StudentRankBean.GradesBean item) {
        helper.setText(R.id.text_rank, CommonUtil.getStr(item.getGradeName()));
        if (selectId == item.getGradeId()) {
            helper.setBackgroundRes(R.id.lin_bg, R.drawable.shape_rectangle_round_bg_theme_20)
                    .setTextColor(R.id.text_rank, Color.WHITE);
        }

    }
}
